package com.hakim.wfb.common.enums;

/**
 * 消费模式
 * Created by walkman on 2017/7/26.
 */
public enum ConsumeModeEnum {

    WEEK(1, "期消模式"),
    MONTH(2, "月消模式");

    private int value;

    private String description;

    private ConsumeModeEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static ConsumeModeEnum getByValue(int value) {
        ConsumeModeEnum[] codes = values();
        for (ConsumeModeEnum each : codes) {
            if (each.value == value) {
                return each;
            }
        }
        return null;
    }
}
